package com.snow.dayou.controller;


import com.snow.common.config.MinioUtils;
import com.snow.dayou.service.feign.MallfeignService;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

/**
 * All rights Reserved, Designed By www.cusc.com
 *
 * @author yanke
 * @Title: UserController
 * @Package com.snow.dayou.controller
 * @Description:类描述
 * @Email yanke@cu-sc.com
 * @version: v1.0.0
 * @date: 2021/3/31/0031 16:39
 * @Copyright: 2021  www.faw.com.cn Inc. All rights reserved. <br/>
 * Modification History:<br/>
 * Date         Author          Version            Description<br/>
 * *---------------------------------------------------------*<br/>
 * 2021/3/31/0031     Administrator           v1.0.0               修改原因<br/>
 * @since JDK 1.8
 */
@Slf4j
@RestController
@RequestMapping("/user")
public class UserController {

    @Autowired(required = false)
    private MinioUtils minioUtils;
    @Autowired
    private MallfeignService mallfeignService;

    @GetMapping("/{id}")
    public String login(@PathVariable Long id) {
        log.info("用户登录:{}", id);
        return String.valueOf(id);
    }

/*    @GetMapping("/tomall")
    public String loginToMall() {
        Boolean b = mallfeignService.queryMallNacosConfig();
//        String forObject = restTemplate.getForObject("http://mall/mall/nacos", String.class);
//        userService.event("准备开始");
        return String.valueOf(b);
    }*/

/*    @GetMapping("/getUserInfo/{id}")
    public UserInfo getUserInfo(@PathVariable(value = "id") Long id) {
        UserInfo userInfo = userInfoService.getById(id);
        return userInfo;
    }*/

//    @GetMapping("/minio")
//    public String minio() {
//        String endpoint = minioUtils.getMinioConfig().getEndpoint();
//        minioUtils.uploadFile();
//        return endpoint;
//    }

}
